<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js_getElementById</title>
    <style>
        button
        {
            background-color: #BBBBBB;
            font: 14px '微软雅黑';
            color: #0b2e13;
            width: 80px;
            height: 30px;
            text-align: right;
        }
    </style>
</head>
<body>
<button id="btn">按钮</button>
<script>
    document.getElementById("btn").onclick=function () {
        alert(123123)
        //console.log(document.getElementById("btn"))
    }
</script>
</body>
</html>